package com.xuecheng.media.domain.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xuecheng.base.model.PageResult;
import com.xuecheng.media.domain.model.ChunkMergeDo;
import com.xuecheng.media.domain.model.ChunkUploadDo;
import com.xuecheng.media.domain.model.FileUploadDo;
import com.xuecheng.media.domain.model.entity.MediaFiles;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 媒资信息 服务类
 * </p>
 *
 * @author itcast
 * @since 2024-08-04
 */
public interface MediaFilesService extends IService<MediaFiles> {

    MediaFiles uploadFile(FileUploadDo fileUploadDo, String absolutePath, Long companyId, String objectName);

    MediaFiles addMediaFileToDb(String filePath, FileUploadDo fileUploadDo, String fileMd5, String bucketFiles, Long companyId);

    void addMediaFileToMinio(String absolutePath, String mimeType, String bucketFiles, String filePath);

    Boolean checkMinioFileExit(MediaFiles mediaFiles);

    Boolean checkChunkExit(String fileMd5, Integer chunk);

    void uploadChunk(ChunkUploadDo chunkUploadDo);

    void mergeChunks(ChunkMergeDo chunkMergeDo);

    PageResult<MediaFiles> queryCourseBasePage(LambdaQueryWrapper<MediaFiles> queryWrapper, Page<MediaFiles> objectPage);

    void updateMediaFiles(MediaFiles mediaFiles);
}
